import request from "@/utils/request";

enum API {
    dashboard_URL = "/itp/api/dashboard",
    general_URL = "/itp/api/report/business/call",
    deptCapitalOccupation_URL = "/itp/api/deptCapitalOccupation",
    businessCapitalFee_URL = "/itp/api/businessCapitalFee",
    commissionFee_URL = "/itp/api/business/commission/fee",
    reportsum_URL="/itp/api/accountFund/reportSum",
    fund_URL = "/itp/api/interface/fund/valuation",
    Risk_URL = "/itp/api/report/dashboard/risk",
    etf_URL = "/itp/index/etf/reward",
    
    fund_productInfo_URL = "/itp/api/interface/fund/productInfo",
}   
    
export default{
    getDashboard:(param:any)=>request.post(`${API.dashboard_URL}/query`,param),
    getGeneralReport:(param:any)=>request.post(`${API.general_URL}`,param),
    exportDashboard:(param:any)=>request.exportFile(`${API.dashboard_URL}/export`,param),
    exportDbDetail:(param:any)=>request.exportFile(`${API.dashboard_URL}/detail/export`,param),
    exportInvestProfit:(param:any)=>request.exportFile(`${API.dashboard_URL}/invest/profit/export`,param),
    
    getCapOccList: (current: number, size: number, data: any) => request.post(`${API.deptCapitalOccupation_URL}/query/occupation/data?current=${current}&size=${size}`, data),
    capOccDelete: (id: number) => request.delete(`${API.deptCapitalOccupation_URL}/delete/${id}`),
    capOccSave: (param: any) => request.post(`${API.deptCapitalOccupation_URL}/add`,param),
    

    getCapFeeList: (current: number, size: number, data: any) => request.post(`${API.businessCapitalFee_URL}/query/capitalFee/data?current=${current}&size=${size}`, data),
    capFeeDelete: (id: number) => request.delete(`${API.businessCapitalFee_URL}/delete/${id}`),
    capFeeSave: (param: any) => request.post(`${API.businessCapitalFee_URL}/add`,param),

    getBussinessFeeList: (current: number, size: number, data: any) => request.post(`${API.commissionFee_URL}/query/data?current=${current}&size=${size}`, data),
    bussinessFeeDelete: (id: number) => request.delete(`${API.commissionFee_URL}/delete/${id}`),
    bussinessFeeSave: (param: any) => request.post(`${API.commissionFee_URL}/add`,param),
    postAccountFundReportSum:(param: any)=>request.post(`${API.reportsum_URL}`,param), //部门整体盈亏与持仓

    getFundList: (current: number, size: number, data: any) => request.post(`${API.fund_URL}/page?current=${current}&size=${size}`, data),

    getRiskList:(param:any)=>request.post(`${API.Risk_URL}/call`,param),
    exportRisk:(param:any)=>request.exportFile(`${API.Risk_URL}/export`,param),

    getEtfRewardList: (current: number, size: number, data: any) => request.post(`${API.etf_URL}/page?current=${current}&size=${size}`, data),
    addEtfReward:(param:any)=>request.post(`${API.etf_URL}`,param),
    updateEtfReward:(param:any)=>request.put(`${API.etf_URL}`,param),
    deleteEtfReward:(param:any)=>request.delete(`${API.etf_URL}/${param}`),

    selectFundProductInfo: ( data: any) => request.post(`${API.fund_productInfo_URL}/select`, data),
}
